package com.baijia.common.dto.request;

import org.apache.commons.lang.StringUtils;

import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@Getter
@Setter
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true, exclude = { "newPassword", "retypePassword", "smsCode" })
public class ChangePwdBySmsCodeRequest extends ProfileRequest {

    public String newPassword; // 新密码
    public String retypePassword; // 二次输入的新密码
    public String smsCode; // 短信验证码

    @Override
    public boolean isValidRequest() {
        return StringUtils.isNotEmpty(mobile) && StringUtils.isNotEmpty(smsCode) && StringUtils.isNotEmpty(newPassword)
            && StringUtils.isNotEmpty(retypePassword) && newPassword.equals(retypePassword) && super.isValidRequest();
    }

}